<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- 
<style>
    *{padding: 0;
    margin: 0;}
    h1{
        text-align: center;
    }
    form{
        width: 1000px;
        border: 1px solid black;
    margin: 0 auto;}
    form div{
width: 100%;
margin:10px 40%;
    }
    button{
        width: 100px;
        height: 20px;
        margin: 10px 40%;
        background-color: pink;
        margin: 10px 45%;
    }
</style>
<body>
    <h1>用户登录案例</h1>
    <form>
        <div>
            <label for="inp">账号</label>
            <input id="inp" type="text" placeholder="请输入账号">
        </div>
<div>
        <label for="pass">密码</label>
        <input id="pass" type="password" placeholder="请输入密码">
        </div>
        <button id="button">登录</button>
    </form>
</body>
</html>
//获取标签节点，账号 -->
<!-- var userName = document.getElementById('inp')//账号
var pass = document.getElementById('pass')//密码
var button = document.getElementById('button')//按钮

//点击事件
button.onclick = function(){
    var userValu = userName.value//账号值
    var passValu = pass.value//密码值
    if(
        userValu == 'admin' && passValu == '123'){
        alert('登录成功')
}else{
    alert('账号密码错误')
}
} --> -->
<script>
    //switch分支语句
    // var a = 10;
    // switch(a){
    //     case 是否满足表达式 : alert('成功执行');
    // }
</script>